## Create and Export Cross Tables
table_unc_ISSP <- table(clean_ISSP_data$high_meaning)
table_unc_ISSP <- prop.table(table_unc_ISSP)
meaning_unc_ISSP <- table_unc_ISSP[2]

table_tel_ISSP <- table(clean_ISSP_data$high_meaning, clean_ISSP_data$high_telecommute)
table_tel_ISSP <- prop.table(table_tel_ISSP)
meaning_tel <- table_tel_ISSP[2,2]

table_flex_ISSP <- table(clean_ISSP_data$high_meaning, clean_ISSP_data$high_flex)
table_flex_ISSP <- prop.table(table_flex_ISSP)
meaning_flex <- table_flex_ISSP[2,2]

table_tel_flex_ISSP <- table(clean_ISSP_data$high_meaning, clean_ISSP_data$high_telecommute, clean_ISSP_data$high_flex)
table_tel_flex_ISSP <- prop.table(table_tel_flex_ISSP)
meaning_tel_flex <- table_tel_flex_ISSP[2,2,2]

frequencies_ISSP <- data.frame(meaning_unc_ISSP, meaning_tel, meaning_flex, meaning_tel_flex)
colnames(frequencies_ISSP) <- c("Mean", "$\\times$ Telecommuting", 
                                "$\\times$ Schedule Adaptability", 
                                "$\\times$ Both")
rownames(frequencies_ISSP) <- "High Meaning"

table_flex_ISSP <- xtable::xtable(frequencies_ISSP)
hlines <- c(-1, -1,  0, 1, nrow(table_flex_ISSP))

print.xtable(table_flex_ISSP, include.rownames = TRUE, include.colnames = TRUE, floating = FALSE, type = "latex", hline.after = hlines)
writeLines(xtable::print.xtable(table_flex_ISSP, include.rownames = TRUE, include.colnames = TRUE, floating = FALSE, type = "latex", hline.after = hlines, sanitize.colnames.function = identity), file.path(graph_dir, "table_flex_tel_ISSP.txt"))